﻿using MySql.Data.MySqlClient;
using Mysqlx.Crud;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace 天上
{
    public partial class RoomMaintenanceFrom : Form
    {
        public RoomMaintenanceFrom()
        {
            InitializeComponent();
        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {

        }

        private void RoomMaintenanceFrom_Load(object sender, EventArgs e)
        {

        }

        private void Copy_Click(object sender, EventArgs e)
        {   
                Clipboard.SetText(StaffId_Text.Text);   
        }
        /// <summary>
        /// 连接数据库的数据
        /// </summary>
        string name = "server = xxxx;database = 酒店管理系统; user = root; password = 123456";
        private void Add_Click(object sender, EventArgs e)
        {
            using (MySqlConnection conn = new MySqlConnection(name)) {
                using (MySqlCommand cmd = new MySqlCommand("insert into " +
                "sromm(room_ID,room_type,room_price ,room_number,room_FID,room_FnumberId,room_zt,room_Bed,room_Towards,guest_room,Telephone_extension,Telephone,room_Name,room_Postscript) " +
                "values(@room_ID,@room_type,@room_price ,@room_number,@room_FID,@room_FnumberId,@room_zt,@room_Bed,@room_Towards,@guest_room,@Telephone_extension,@Telephone,@room_Name,@room_Postscrip)", conn)) {
                    //拼音码
                    cmd.Parameters.AddWithValue("@name", name);
                    //房间类型
                    cmd.Parameters.AddWithValue("@name", name);
                    //房间价格
                    cmd.Parameters.AddWithValue("@name", name);
                    //房间号
                    cmd.Parameters.AddWithValue("@name", name);
                    //楼层
                    cmd.Parameters.AddWithValue("@name", name);
                    //楼栋号
                    cmd.Parameters.AddWithValue("@name", name);
                    //房屋状态
                    cmd.Parameters.AddWithValue("@name", name);
                    //房间床数
                    cmd.Parameters.AddWithValue("@name", name);
                    //房屋朝向
                    cmd.Parameters.AddWithValue("@name", name);
                    //是否为客房
                    cmd.Parameters.AddWithValue("@name", name);
                    //电话分机
                    cmd.Parameters.AddWithValue("@name", name);
                    //电话外机
                    cmd.Parameters.AddWithValue("@name", name);
                    //房间描述
                    cmd.Parameters.AddWithValue("@name", name);
                    //备注说明
                    cmd.Parameters.AddWithValue("@name", name);


                }
            }
            
            
        }
    }
}
